$(function() {
	rt();
});
var maxd = 0;
function rt(){
	var guide_id = getParameter("guiId");
	var uid=getParameter("uid");
	var urlStr = serverPath + "/app/doctor/diabetes/guideView.do";
	var jsonStr = '{method:"getGuidance",requestlist:[{guideid:"'+guide_id+'"}],uid:"'+uid+'" , version:"1.0", requestsource:"diabetes"}' ;
	
	UseAjax(urlStr, jsonStr, document.cookie, guidedesc, '1');
}

function guidedesc(nodeArrays) {
	var nodeArray=nodeArrays.resultlist[0].resultlist;
	if (nodeArray && nodeArray.guide_id && nodeArray.guide_date) {
		var id = nodeArray.guide_id;
		var name = nodeArray.guide_name;
		var date = nodeArray.guide_date;
		var result = nodeArray.result_value;
	
		
		$("#guidedesc").show();
		
		
			if (name) {
				$('#chart_title').html(date+''+name);
			} else {
				$('#chart_title').hide();
			}
			$('#chart_content').hide();
			var text = '';
			
			text = text + '<h3>'+result+'</h3>';
			
			$('#chart_content').html(text);
			$('#chart_content').show();
		
	}
}

// 获取url参数
function getParameter(param) {
	var query = window.location.search;
	var iLen = param.length;
	var iStart = query.indexOf(param);
	if (iStart == -1)
		return "";
	iStart += iLen + 1;
	var iEnd = query.indexOf("&", iStart);
	if (iEnd == -1)
		return query.substring(iStart);
	return query.substring(iStart, iEnd);
}